Ext.define('Sh.ux.MonthField', {
    extend: 'Ext.form.field.Date',
    alias: 'widget.monthfield',
    startDay: new Date(),
	format: 'Y-m',
	submitFormat: 'Y-m',
    createPicker: function () {
        var me = this;

        return Ext.create('Ext.picker.Month', {
            pickerField: me,
            ownerCt: me.ownerCt,
            floating: true,
            shadow: false,
            focusOnShow: true,
            listeners: {
                scope: me,
                cancelclick: me.onCancelClick,
                okclick: me.onOkClick,
                yeardblclick: me.onOkClick,
                monthdblclick: me.onOkClick
            }
        });
    },
    onOkClick: function (picker, value) {
        var me = this,
            month = value[0],
            year = value[1],
            date = new Date(year, month, 1);
        me.startDay = date;
        me.setValue(date);
        this.picker.hide();
        me.collapse();
        //this.blur();
    },
    onCancelClick: function () {
        this.picker.hide();
        me.collapse();
        //this.blur();
    }

});